<template>
  <div class="pagination-warp">
    <el-pagination :hide-on-single-page="true" :total="totalNum" layout="prev, pager, next" @current-change="currentChange"></el-pagination>
  </div>
</template>

<script>
export default {
  name: "pagination",
  props:{
      totalNum: Number
  },
  methods:{
      currentChange(currentIndex){
          this.$emit("indexChange",currentIndex);
      }
  }
};
</script>

<style>
.pagination-warp {
    display: flex;
    justify-content: center;
}
</style>